<%--
    Copyright 2010 mazhao.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    under the License.
  Created by IntelliJ IDEA.
  User: mazhao
  Date: 2010/11/07
  Time: 13:59:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<div class="span-24 last">
    <div class="span-20">
    <s:a namespace="/front" action="index">
        <img src="<%=request.getContextPath()%>/images/shopping.jpg" alt="shopping logo" width="50px"
             height="50px"/>
    </s:a>
    <span class="alt">
        <font size="24"><s:text name="shopping.name"/> </font>
        <s:if test="#session.shopping_customer_logininfo.username != null">
            &nbsp;&nbsp;Welcome <s:property value="#session.shopping_customer_logininfo.username"/>!
            <s:if test=" #session.shopping_font_cart != null">
                &nbsp;&nbsp;<s:a namespace="/front" action="cart">Shopping Cart</s:a>
            </s:if>
            &nbsp;&nbsp;<s:a namespace="/front" action="exit">Logout</s:a>
            &nbsp;&nbsp;<s:a namespace="/customer" action="showclientcenter">Client Center</s:a>
            <s:if test="#session.shopping_customer_logininfo.role == 'admin'">
                &nbsp;&nbsp;<s:a action="center" namespace="/management">Management</s:a>
            </s:if>
        </s:if>
        <s:else>
            &nbsp;&nbsp;<s:a namespace="/front" action="cart">Shopping Cart</s:a>
            <!--
            <s:if test=" #session.shopping_font_cart != null">
                &nbsp;&nbsp;<s:a namespace="/front" action="cart">Shopping Cart</s:a>
            </s:if>
            -->
            &nbsp;&nbsp;<s:a action="login" namespace="/front">Login</s:a>
            <s:url var="registerUrl" namespace="/front" action="login">
                <s:param name="type" value="%{'register'}"/>
            </s:url>
            &nbsp;&nbsp;<s:a  href="%{registerUrl}">Register</s:a>
        </s:else>
    </span>
    </div>
    <div class="span-4 last" style="vertical-align:bottom;">
        <br/>
        <s:a namespace="/front" action="group" cssClass="alt">Group</s:a>
        <a href="#" class="alt">Snapper</a><br/>

        <s:url id="clen" action="index" namespace="/front">
            <s:param name="request_locale">en</s:param>
        </s:url>
        <s:url id="clzh" action="index" namespace="/front">
            <s:param name="request_locale">zh_CN</s:param>
        </s:url>
        <s:url id="clja" action="index" namespace="/front">
            <s:param name="request_locale">ja_JP</s:param>
        </s:url>
        <s:a href="%{clen}" cssClass="alt">English</s:a>
        |
        <s:a href="%{clzh}" cssClass="alt">Chinese</s:a>
        |
        <s:a href="%{clja}" cssClass="alt">Japanese</s:a>

        <br/>
    </div>
</div>